package com.epoint.mobileoa.ui.main;

import java.util.ArrayList;
import java.util.List;

import android.content.Intent;

import com.epoint.mobile.demo.tab.TestTabView;
import com.epoint.mobileoa.R;
import com.epoint.mobileoa.bizlogic.ConfigKey;
import com.epoint.mobileoa.bizlogic.GVIcon;
import com.epoint.mobileoa.bizlogic.SuperView;
import com.epoint.mobileoa.db.DBHelp;
import com.epoint.mobileoa.personalized.epointcompany.ui.ChuChaijihuaList;
import com.epoint.mobileoa.personalized.epointcompany.ui.carnumberquery.CarNumberQueryView;
import com.epoint.mobileoa.personalized.epointcompany.ui.kaoqing.KaoQingView;
import com.epoint.mobileoa.tools.PropertiesHelp;
import com.epoint.mobileoa.ui.attachmanager.AttachManagerView;
import com.epoint.mobileoa.ui.contacts.ContactsView;
import com.epoint.mobileoa.ui.ds.DSView;
import com.epoint.mobileoa.ui.handwrittensign.HandwrittenSignDetail;
import com.epoint.mobileoa.ui.infopub.InformationPubView;
import com.epoint.mobileoa.ui.mail.MailMain;
import com.epoint.mobileoa.ui.notice.NoticeListView;
import com.epoint.mobileoa.ui.statistics.StatisticsMain;
import com.epoint.mobileoa.ui.sysconfig.SysconfigView;
import com.epoint.mobileoa.ui.todolist.TodolistView;
import com.epoint.mobileoa.ui.toolview.Tool9ggView;
import com.epoint.mobileoa.ui.update.UpdateView;
import com.epoint.mobileoa.ui.wsgw.WsDbListView;

/**
 * MobileOA3.0
 * @author liyc
 * @time 2013-1-4 下午5:11:16 
 */
public class MainViewIconInstance {
	public List<GVIcon> iconDataSource(SuperView con){
		List<GVIcon> iconList = new ArrayList<GVIcon>();
		Class dbclass;
		String dbtype = PropertiesHelp.getProperty(con, "TodoServerType");
		if(dbtype.equals("1"))
		{
			dbclass = WsDbListView.class;
		}
		else{
			dbclass = TodolistView.class;
		}
		dbclass = TodolistView.class;
		GVIcon gi = new GVIcon(con, R.drawable.dbsy, "待办事宜", dbclass, null);
		iconList.add(gi);

//		gi = new GVIcon(con, R.drawable.sxqp, "手写签批", HandwrittenSignDetail.class, null);
//		iconList.add(gi);

//		gi = new GVIcon(con, R.drawable.dbsy, "Tab Test", TestTabView.class, null);
//		iconList.add(gi);

		gi = new GVIcon(con, R.drawable.gwyj, "公务邮件", MailMain.class, null);
		iconList.add(gi);
		gi = new GVIcon(con, R.drawable.tzgg, "通知公告", NoticeListView.class, null);
		iconList.add(gi);
		gi = new GVIcon(con, R.drawable.txl, "通讯录", ContactsView.class, null);
		iconList.add(gi);
		//		gi = new GVIcon(this, R.drawable.img_txtj, "图表统计", GraphicalActivity.class, null);
		//		iconList.add(gi);
		//		gi = new GVIcon(this, R.drawable.img_lcdy, "流程设计", DragActivity.class, null);
		//		iconList.add(gi);

		if(con.getString(R.string.APKType).equals("2")){
			Intent itrizhi = new Intent();
			itrizhi.putExtra("titles", new String[]{"我的日志","日志审核"});
			itrizhi.putExtra("imgs", new int[]{R.drawable.img_wdrz, R.drawable.img_rzsh});
			String[] classesName = new String[]{
					"com.epoint.mobileoa.personalized.epointcompany.ui.PersonalRiziListView",
					"com.epoint.mobileoa.personalized.epointcompany.ui.gzrz.RizhiShenHeListView"
			};
			itrizhi.putExtra("classesName", classesName);
			gi = new GVIcon(con, R.drawable.img_epoint_gzrz, "工作日志", Tool9ggView.class, itrizhi);
			iconList.add(gi);
			gi = new GVIcon(con, R.drawable.kqqd, "考勤签到", KaoQingView.class, null);
			iconList.add(gi);
			gi = new GVIcon(con, R.drawable.img_epoint_ccdj3, "出差计划", ChuChaijihuaList.class, null);
			iconList.add(gi);
			gi = new GVIcon(con, R.drawable.xxfb, "信息发布", InformationPubView.class, null);
			iconList.add(gi);
			
			gi = new GVIcon(con, R.drawable.cpcx, "车牌查询", CarNumberQueryView.class, null);
			iconList.add(gi);
		}
		gi = new GVIcon(con, R.drawable.fjgl, "附件管理", AttachManagerView.class, null);
		iconList.add(gi);
		gi = new GVIcon(con, R.drawable.sjtb, "数据同步", DSView.class, null);
		iconList.add(gi);

		gi = new GVIcon(con, R.drawable.xtsz, "系统设置", SysconfigView.class, null);
		iconList.add(gi);
//		gi = new GVIcon(con, R.drawable.rjgx, "软件更新", UpdateView.class, null);
//		iconList.add(gi);
//
//		if(DBHelp.getConfigValue(con, ConfigKey.isAdmin).equals("1"))
//		{
//			gi = new GVIcon(con, R.drawable.xtrz, "系统日志", StatisticsMain.class, null);
//			iconList.add(gi);
//		}

		return iconList;
	}
}
